from django.db import models

# Create your models here.
from django.db import models

from utils.base_models import BaseModel


class Monitor(BaseModel):
    """
    关键点监控
    """
    pod_name_tag = (
        (1, "hwy-gz.yaml"),
        (2, "comprehensive.yaml"),
    )
    id = models.AutoField(verbose_name='id主键', primary_key=True, help_text='id主键')
    version = models.CharField('项目', max_length=500, help_text='项目', null=True)
    module = models.CharField('模块', max_length=500, help_text='模块', null=True)
    describe = models.CharField('场景描述', max_length=500, help_text='场景描述', null=True)
    monitoring_frequency = models.CharField('监控频次', max_length=500, help_text='监控频次', null=True)
    finish_schedule = models.IntegerField(verbose_name='完成进度', help_text='完成进度', default=0, null=True)
    K8s_name = models.CharField('K8s_name', max_length=500, help_text='K8s_name', null=True)
    pod_name = models.IntegerField('pod_name', help_text='pod_name', null=True, choices=pod_name_tag)
    tester = models.CharField('测试人员', max_length=500, help_text='测试人员', null=True)
    finish_time = models.DateField('完成时间', help_text='完成时间', null=True)

    class Meta:
        db_table = 'tb_monitor'
        verbose_name = '监控'
        verbose_name_plural = verbose_name
        ordering = ('finish_time',)
